package ui.panel.showroom;

import cerebrum.common.CommonConst;
import cerebrum.common.OsUtil;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.StageStyle;
import ui.factory.SingletonFactory;
import ui.util.Window;

import java.io.IOException;
import java.net.URL;

public class WallpaperStage extends Window {
    private static WallpaperStage instance = null;

    //调用单例工厂
    public static WallpaperStage getInstance() {
        if (instance == null) {
            instance = SingletonFactory.getWeakInstace(WallpaperStage.class);
        }
        return instance;
    }

    public WallpaperStage() throws IOException {
        URL resource = getClass().getResource("/fxml/WallpaperStage.fxml");
        root = FXMLLoader.load(resource);

        Scene scene = new Scene(root, CommonConst.SYSTEMWIDTH, CommonConst.SYSTEMHEIGHT);
        initStyle(StageStyle.TRANSPARENT);
        setScene(scene);
        setTitle("IceoLogy_ScreenSaver");

        show();
        OsUtil.setWinIconAfter("IceoLogy_ScreenSaver");

    }
}